
import org.w3c.dom.Node;

import Controller.CreateResponseController;
import Controller.SignInResponseController;

import xml.Message;
import client.IMessageHandler;

	/** this will handle all the Message types
	 * 
	 * @author zhaolongli
	 *
	 */

public class DecisionLinesMessageHandler implements IMessageHandler {

	@Override
	public void process(Message response) {
		Node child = response.contents.getFirstChild();
		String type = child.getLocalName();
		
	    if (type.equals("createResponse")) {
	    	System.out.println("Message handler createResponse processing.......");
	    	new CreateResponseController().process(response);
	    } else if (type.equals("signInResponse")) {
	    	new SignInResponseController().process(response);
	    }
	    
		System.out.println("Received:" + response);
	}

}